<!DOCTYPE html>
<html>
<head>
<title>Centos7Redis安装教程</title>
<meta charset='utf-8'>
<link href='https://dn-maxiang.qbox.me/res-min/themes/marxico.css' rel='stylesheet'>
<style></style>
</head>
<body>
<div id='preview-contents' class='note-content'>

<h2 id="安装redis">安装 redis</h2>

<hr>

<ul>
	<strong>安装必要环境 </strong>
	<li>
		<p>
			gcc编译工具
		</p>
	</li>
	
</ul>

<pre class="prettyprint hljs-dark">
	<code class="hljs bash">
		<span class="hljs-keyword">1、安装在 usr/local/redis目录下</span>
		cd usr/local
		mkdir redis
		cd redis
		
		<span class="hljs-keyword">2、下载redis安装包</span>
		wget http://download.redis.io/releases/redis-3.2.8.tar.gz
		
		<span class="hljs-keyword">3、解压</span>
		tar zxvf redis-3.2.8.tar.gz
		
		<span class="hljs-keyword">4、编译</span>
		make
		出现Jemalloc/Jemalloc:h文件目的找不到运行 make distclean  再次make
		
		<span class="hljs-keyword">5、安装</span>
		make install
		
		<span class="hljs-keyword">6、关闭受保护模式否则客户端无法联机</span>
		vi redis.conf
		注释掉 bind 127.0.0.1
		protected-mode yes 为 no
		daemonize no 为 yes


		<span class="hljs-keyword">3、解压</span>
		<span class="hljs-string">"imagename eq nginx.exe"</span>
	</code>
</pre>

</div>
</body>
</html>